import axios from "@/utils/axios";
// 代言商品
export function getPresentGoods() {
  return axios.request({
    url: '/front/represent/represent',
    method: 'get',
    params: { type: 'list'}
  })
}
export function submitOrder({ address_id, city_str, detail, realname, pay_type, commodity_id, name, price, buy_number, img_show, mobile, freight, province, city, prefecture }) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'post',
    data: {type: 'createOrder', address_id, city_str, detail, realname, pay_type, commodity_id, name, price, buy_number, img_show, mobile, freight, province, city, prefecture}
  })
}
export function balancePay(order_no) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'post',
    data: {type: 'balancePay', order_no,}
  })
}
export function getRepresentOrderDetail(id) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'get',
    params: { type: 'myOrderInfo', id }
  })
}
export function getRepresentOrderList(page, status) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'get',
    params: {type: 'myOrder', page, order_status: status }
  })
}
export function changeRepresentOrderStatus(id, myType) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'post',
    data: {type: 'updateOrderStatus', id, myType}
  })
}
export function deleteRepresentOrder(id) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'post',
    data: { type: 'deleteOrder', id }
  })
}
export function uploadFile(photo) {
  return axios.request({
    url: '/common/upload',
    method: 'post',
    data: photo
  })
}
export function representUpload({ image, id, status, my_id}) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'post',
    data: {type: 'feedback', image, id, status, my_id }
  })
}
export function getBalance() {
  return axios.request({
    url: '/front/user/center',
    method: 'get',
    params: {type: 'balance'}
  })
}
export function getUploadFileList(order_id) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'get',
    params: {type: 'myFeedback', order_id }
  })
}
export function judgeCash({order_id, refund_amount}) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'post',
    params: { type: 'applyRefund', refund_amount, order_id }
  })
}
export function getCashStatus(order_id) {
  return axios.request({
    url: '/front/represent/represent',
    method: 'get',
    params: { type: 'getRefundApplyStatus', order_id}
  })
}